package com.care.entity;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

@Entity
@Table(name="knowledge")
public class Knowledge {
	private int id;
	private String img;//图片	
	private String title;//主题
	private String content;//内容
	private Doctor doctor;//医护知识与医生的对应	
	public Knowledge(){
		
	}


	public Knowledge(int id, String img, String title, String content, Doctor doctor) {
		super();
		this.id = id;
		this.img = img;
		this.title = title;
		this.content = content;
		this.doctor = doctor;
	}

	@Id
	@GeneratedValue(strategy=GenerationType.IDENTITY)
	public int getId() {
		return id;
	}
	
	public void setId(int id) {
		this.id = id;
	}
	



	@Column(name="title")
	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	@Column(name="content")	
	public String getContent() {
		return content;
	}

	public void setContent(String content) {
		this.content = content;
	}
	@Column(name="img")
	public String getImg() {
		return img;
	}
	public void setImg(String img) {
		this.img = img;
	}

	@ManyToOne()
    @JoinColumn(name="dk")
	public Doctor getDoctor() {
		return doctor;
	}

	public void setDoctor(Doctor doctor) {
		this.doctor = doctor;
	}

	@Override
	public String toString() {
		return "Knowledge [id=" + id + ", img=" + img + ", title=" + title + ", content=" + content + ", doctor="
				+ doctor + "]";
	}



	
	
}
